<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta charset="utf-8" />
	<title>主页面</title>
	<link rel="stylesheet" href="bootStrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="logo">
	<span class="large-font col-md-4" style="color: #d0d0d0;font-size: 36px"><b class="large-font" style="color: #4f9fee;">cqie</b>在线商城后台管理系统</span>
	<div class="col-md-4 search">
		<form class="bs-example bs-example-form" role="form">
			<div class="row">
				<div class="col-lg-6">
					<div class="input-group">
						<input type="text" class="form-control" placeholder="请输入内容">
						<span class="input-group-btn">
							<button class="btn btn-primary" type="button">
								Go!
							</button>
						</span>
					</div>
				</div>
			</div>
		</form>
	</div>
	<span class="large-font col-md-2 text-center" style="color: #b63900; font-size: 32px;line-height:65px ;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"><b style="color: #d0d0d0;">欢迎：</b>${user.nickname }</span>
	<div class="dropdown col-md-2">
		<span class="user-avatar">
			<img src="${user.headImg }" id="avatar" class="avatar">
			<form id="img_file"  action="./upload.do" method="post" enctype="multipart/form-data">
				<input type="file"  id="file-input" name="f1" >
				<input type="submit" value="提交">
			</form>
		</span>
		<button type="button" class="btn dropdown-toggle" id="userCenterDropdown" data-toggle="dropdown">个人中心
			<span class="caret"></span>
		</button>
		<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="userCenterDropdown">
			<li role="presentation">
				<a role="menuitem" tabindex="-1" href="#">查看日志</a>
			</li>
			<li class="dropdown-divider"></li>
			<li role="presentation">
				<a role="menuitem" tabindex="-1" href="../logout">退出登录</a>
			</li>
		</ul>
	</div>
</div>
<div class="container-fluid">
	<div class="row main">
		<div class="col-md-3 nav">
			<ul class="list-group" style="font-size: 22px;">
				<li class="list-group-item"><a href="#" onclick="javascript:toUrl('../goodsList')"><i class="glyphicon glyphicon-shopping-cart"></i> 商品管理</a></li>
				<li class="list-group-item"><a href="#" onclick="javascript:toUrl('../typeList')"><i class="glyphicon glyphicon-folder-open"></i> 类别管理</a></li>
				<li class="list-group-item"><a href="#" onclick="javascript:toUrl('../orderList')"><i class="glyphicon glyphicon-list-alt"></i> 订单管理</a></li>
				<li class="list-group-item"><a href="#"><i class="glyphicon glyphicon-comment"></i> 评论管理</a></li>
				<li class="list-group-item"><a href="#" onclick="javascript:toUrl('../userList')"><i class="glyphicon glyphicon-user"></i> 用户管理</a></li>
                <li class="list-group-item"><a href="../logout"><i class="glyphicon glyphicon-log-out"></i> 退出登录</a></li>
			</ul>
		</div>
		<div class="col-md-9 content">
			<div class="content-body">
				<iframe id="content" src="../goodsList" width="100%" height="100%" frameborder="0"></iframe>
			</div>
		</div>
	</div>
</div>

<script src="js/jquery-3.7.1.js"></script>
<script src="bootStrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
	function toUrl(url){
		document.getElementById("content").src=url;
	}
	//头像

	document.addEventListener('DOMContentLoaded', function() {
		const avatar = document.getElementById('avatar');
		const fileInput = document.getElementById('file-input');

		avatar.addEventListener('click', function() {
			fileInput.click();
		});
	});
	//提交
	document.getElementById('file-input').addEventListener('change', function() {
		document.getElementById('img_file').submit();
	});

</script>
</body>
</html>